import fetch from 'assets/js/fetch'
import { AJAX_SERVICE_HOST } from 'api/config'

export function getUploadToken(params) {
  const url = AJAX_SERVICE_HOST + 'qiniu/getUploadToken'
  return fetch.get(url, params)
}

export function getApiUrl(url) {
  return AJAX_SERVICE_HOST + (url.startsWith('/') ? url.substring(1) : url)
}

export function queryNews() {
  return fetch.get(AJAX_SERVICE_HOST + 'common/news', {})
}